from django.urls import path
from apps.recruit.views import RecommendJobView,NewestJobView,HotEnterpriseView,DetailJobView,DetailEnterpriseView,\
    RecruitVisitCountView,EnterpriseVisitCountView,HotCityView,SearchView,CollectionRecruitView,RemoveCollectionView,RemoveCollectionEnterpriseView

urlpatterns = [
    path('recruits/<id>/',DetailJobView.as_view()),
    path('enterprise/<id>/',DetailEnterpriseView.as_view()),
    path('recruits/<id>/visit/',RecruitVisitCountView.as_view()),
    path('enterprise/<id>/visit/',EnterpriseVisitCountView.as_view()),
    path('recruits/search/city/keyword/',SearchView.as_view()),
    path('recruits/<id>/collect/',CollectionRecruitView.as_view()),
    path('recruits/<id>/cancelcollect/',RemoveCollectionView.as_view()),
    path('enterprise/<id>/collect/',CollectionRecruitView.as_view()),
    path('enterprise/<id>/cancelcollect/',RemoveCollectionEnterpriseView.as_view()),
]

from rest_framework.routers import DefaultRouter
# 可以处理视图的路由器
router = DefaultRouter()
# 向路由器中注册视图集
router.register('recruits/search/recommend', RecommendJobView)
router.register('recruits/search/latest', NewestJobView)
router.register('enterprise/search/hotlist', HotEnterpriseView)
router.register('city/hotlist', HotCityView)

#追加路由
urlpatterns += router.urls